<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>在线支付 - 学平险投保</title>
    <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
    <link href="../css/styles.css" rel="stylesheet">
    <style>
        /* 基础样式保护 */
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            line-height: 1.5;
            color: #333333;
            background-color: #f5f5f5;
            margin: 0;
            padding: 0;
        }
        
        .page-container {
            padding: 16px;
            padding-bottom: 160px;
            max-width: 600px;
            margin: 0 auto;
        }
        
        .card {
            background: white;
            border-radius: 12px;
            padding: 16px;
            margin-bottom: 16px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        }
        
        .nav-bar {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: white;
            box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
            z-index: 100;
        }
        
        .nav-bar .grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 8px;
        }
        
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 8px 0;
            color: #666;
            text-decoration: none;
            font-size: 12px;
        }
        
        .nav-item.active {
            color: #1890ff;
        }
        
        .nav-item i {
            font-size: 20px;
            margin-bottom: 4px;
        }
    </style>
    <style>
        /* 浮动支付区域样式 */
        .payment-float {
            position: fixed;
            bottom: 70px;
            left: 0;
            right: 0;
            background: white;
            border-top: 1px solid #e5e7eb;
            padding: 16px 20px;
            box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
            z-index: 100;
        }

        .payment-info {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
        }

        .payment-amount {
            font-size: 18px;
            font-weight: bold;
            color: #e53e3e;
        }

        .btn-pay {
            width: 100%;
            height: 44px;
            background: linear-gradient(135deg, #1890ff, #096dd9);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
        }

        .btn-pay:hover {
            background: linear-gradient(135deg, #096dd9, #0050b3);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
        }

        .btn-pay:active {
            transform: translateY(0);
        }

        /* 微信支付弹窗样式 */
        .wechat-pay-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            align-items: flex-end;
            justify-content: center;
        }

        .wechat-pay-content {
            background: white;
            border-radius: 16px 16px 0 0;
            padding: 0;
            width: 100%;
            max-width: 100%;
            position: relative;
            transform: translateY(100%);
            transition: transform 0.3s ease-out;
        }

        .wechat-pay-content.show {
            transform: translateY(0);
        }

        .pay-header {
            background: #f8f9fa;
            padding: 20px;
            text-align: center;
            border-bottom: 1px solid #e5e7eb;
        }

        .pay-title {
            font-size: 18px;
            font-weight: bold;
            color: #333;
            margin-bottom: 8px;
        }

        .pay-subtitle {
            font-size: 14px;
            color: #666;
        }

        .pay-body {
            padding: 20px;
        }

        .pay-info-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 0;
            border-bottom: 1px solid #f0f0f0;
        }

        .pay-info-row:last-child {
            border-bottom: none;
        }

        .pay-info-label {
            color: #666;
            font-size: 14px;
        }

        .pay-info-value {
            color: #333;
            font-size: 14px;
            font-weight: 500;
        }

        .pay-amount-large {
            font-size: 24px;
            font-weight: bold;
            color: #e53e3e;
        }

        .payment-method {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .wechat-icon {
            width: 24px;
            height: 24px;
            background: #07c160;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 12px;
        }

        .pay-actions {
            padding: 20px;
            border-top: 1px solid #e5e7eb;
        }

        .btn-pay-confirm {
            width: 100%;
            height: 48px;
            background: #07c160;
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
        }

        .btn-pay-confirm:hover {
            background: #06ad56;
        }

        .btn-pay-cancel {
            width: 100%;
            height: 48px;
            background: #f5f5f5;
            color: #666;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            margin-top: 12px;
            cursor: pointer;
            transition: all 0.3s;
        }

        .btn-pay-cancel:hover {
            background: #e5e5e5;
        }

        /* 页面内容底部间距 */
        .page-container {
            padding-bottom: 160px;
        }
    </style>
</head>
<body>
    <div class="page-container">
        <!-- 页面标题 -->
        <div class="text-center py-6">
            <h2 class="text-xl font-bold mb-2">在线支付</h2>
            <p class="text-gray-600 text-sm">请确认投保信息并完成支付</p>
        </div>

        <!-- 投保信息摘要 -->
        <div class="card">
            <h3 class="text-lg font-bold mb-4">投保信息</h3>
            
            <div class="space-y-4">
                <div class="border-b pb-4">
                    <h4 class="text-gray-500 mb-2">保险信息</h4>
                    <div class="grid grid-cols-2 gap-4">
                        <div>
                            <label class="text-sm text-gray-500">起保日期</label>
                            <p class="font-medium">2025-09-01</p>
                        </div>
                        <div>
                            <label class="text-sm text-gray-500">保障期间</label>
                            <p class="font-medium">一年</p>
                        </div>
                        <div>
                            <label class="text-sm text-gray-500">保费</label>
                            <p class="font-medium text-primary">¥80</p>
                        </div>
                    </div>
                </div>

                <div class="border-b pb-4">
                    <h4 class="text-gray-500 mb-2">投保人信息</h4>
                    <div class="grid grid-cols-2 gap-4">
                        <div>
                            <label class="text-sm text-gray-500">姓名</label>
                            <p class="font-medium">张天龙</p>
                        </div>
                        <div>
                            <label class="text-sm text-gray-500">身份证号</label>
                            <p class="font-medium">220186198704123215</p>
                        </div>
                        <div>
                            <label class="text-sm text-gray-500">手机号</label>
                            <p class="font-medium">13301380808</p>
                        </div>
                    </div>
                </div>

                <div class="border-b pb-4">
                    <h4 class="text-gray-500 mb-2">被保险人信息</h4>
                    <div class="grid grid-cols-2 gap-4">
                        <div>
                            <label class="text-sm text-gray-500">姓名</label>
                            <p class="font-medium">张俊豪</p>
                        </div>
                        <div>
                            <label class="text-sm text-gray-500">身份证号</label>
                            <p class="font-medium">11010320706193525</p>
                        </div>
                        <div>
                            <label class="text-sm text-gray-500">与投保人关系</label>
                            <p class="font-medium">父母/子女</p>
                        </div>
                    </div>
                </div>

                <div>
                    <h4 class="text-gray-500 mb-2">学校信息</h4>
                    <div class="grid grid-cols-2 gap-4">
                        <div>
                            <label class="text-sm text-gray-500">所在地区</label>
                            <p class="font-medium">吉林省-延边州</p>
                        </div>
                        <div>
                            <label class="text-sm text-gray-500">学校名称</label>
                            <p class="font-medium">测试1幼儿园</p>
                        </div>
                        <div>
                            <label class="text-sm text-gray-500">年级</label>
                            <p class="font-medium">幼儿园</p>
                        </div>
                        <div>
                            <label class="text-sm text-gray-500">班级</label>
                            <p class="font-medium">3班</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 浮动支付区域 -->
    <div class="payment-float">
        <div class="payment-info">
            <span class="text-gray-600">保费：</span>
            <span class="payment-amount">80元</span>
        </div>
        <button class="btn-pay" onclick="showWechatPay()">立即支付</button>
    </div>

    <!-- 微信支付弹窗 -->
    <div class="wechat-pay-modal" id="wechatPayModal">
        <div class="wechat-pay-content" id="wechatPayContent">
            <div class="pay-header">
                <div class="pay-title">微信支付</div>
                <div class="pay-subtitle">请确认支付信息</div>
            </div>
            
            <div class="pay-body">
                <div class="pay-info-row">
                    <span class="pay-info-label">收款公司</span>
                    <span class="pay-info-value">世纪保险经纪吉林分公司</span>
                </div>
                <div class="pay-info-row">
                    <span class="pay-info-label">金额</span>
                    <span class="pay-amount-large">¥80.00</span>
                </div>
                <div class="pay-info-row">
                    <span class="pay-info-label">付款方式</span>
                    <div class="payment-method">
                        <div class="wechat-icon">
                            <i class="fab fa-weixin"></i>
                        </div>
                        <span class="pay-info-value">微信支付</span>
                    </div>
                </div>
            </div>
            
            <div class="pay-actions">
                <button class="btn-pay-confirm" onclick="confirmPayment()">支付</button>
                <button class="btn-pay-cancel" onclick="closeWechatPay()">取消</button>
            </div>
        </div>
    </div>

    <!-- 底部导航 -->
    <nav class="nav-bar">
        <div class="grid grid-cols-4 gap-2">
            <a href="home.html" class="nav-item">
                <i class="fas fa-home"></i>
                <span>首页</span>
            </a>
            <a href="consultation.html" class="nav-item">
                <i class="fas fa-comments"></i>
                <span>问题咨询</span>
            </a>
            <a href="claim-guide.html" class="nav-item">
                <i class="fas fa-file-alt"></i>
                <span>我要理赔</span>
            </a>
            <a href="my-orders.html" class="nav-item">
                <i class="fas fa-user"></i>
                <span>我的订单</span>
            </a>
        </div>
    </nav>

    <script>
        // 显示微信支付弹窗
        function showWechatPay() {
            const modal = document.getElementById('wechatPayModal');
            const content = document.getElementById('wechatPayContent');
            
            modal.style.display = 'flex';
            
            // 触发动画
            setTimeout(() => {
                content.classList.add('show');
            }, 10);
        }

        // 关闭微信支付弹窗
        function closeWechatPay() {
            const modal = document.getElementById('wechatPayModal');
            const content = document.getElementById('wechatPayContent');
            
            content.classList.remove('show');
            
            // 等待动画完成后隐藏弹窗
            setTimeout(() => {
                modal.style.display = 'none';
            }, 300);
        }

        // 确认支付
        function confirmPayment() {
            // 这里可以添加实际的支付逻辑
            // 模拟支付成功
            setTimeout(() => {
                closeWechatPay();
                // 跳转到完成页面
                window.location.href = 'insurance-complete.html';
            }, 1000);
        }

        // 点击弹窗外部关闭
        document.getElementById('wechatPayModal').addEventListener('click', function(e) {
            if (e.target === this) {
                closeWechatPay();
            }
        });
    </script>
</body>
</html> 